import pygame

pygame.init()
screen = pygame.display.set_mode((400, 300))
img = pygame.image.load('pygame.jpg')
done = False
bg = (127, 127, 127)
while not done:
    for event in pygame.event.get():
        screen.fill(bg)
        rect = img.get_rect()
        rect.center = 200, 150
        screen.blit(img, rect)
        if event.type == pygame.QUIT:
            done = True
    pygame.display.update()
